import {useState } from 'react'
import { RouteContext, SetRouteContext } from './context/RouteContext'

import './App.css'
import routes from './routes'
import Home from './pages/Home'

function App() {
  const [current, setCurrent] = useState<string>("/")
  
  const CurrentView = routes[current] || Home
  


  return (
    <div className="w-full h-full">
      <RouteContext value={current}>
        <SetRouteContext value={setCurrent}>
          <CurrentView />
        </SetRouteContext>
      </RouteContext>
    </div>
  )
}

export default App
